package cn.bugstack.springframework.core.convert.support;

import cn.bugstack.springframework.core.convert.ConverterFactory;
import cn.bugstack.springframework.core.convert.ConverterRegistry;
import cn.bugstack.springframework.core.convert.GenericConversionService;
import cn.bugstack.springframework.core.convert.StringToNumberConverterFactory;

public class DefaultConversionService extends GenericConversionService {

    public DefaultConversionService() {
        addDefaultConverters(this);
    }

    public static void addDefaultConverters(ConverterRegistry converterRegistry){
        // 添加各类型转换工厂
        converterRegistry.addConverterFactory((ConverterFactory<?, ?>) new StringToNumberConverterFactory());
    }
}
